{include file="public/header"}
        <style scoped>
            .el-select-dropdown {
            padding: 0;
            }
        </style>
         {include file="public/style"}
        <el-breadcrumb separator="/">
            <el-breadcrumb-item>首页</el-breadcrumb-item>
            <el-breadcrumb-item>工具管理</el-breadcrumb-item>
            <el-breadcrumb-item>售后模板</el-breadcrumb-item>
        </el-breadcrumb>
        <br>
        <el-card > 
            <el-table :data="tablelist"   style="width: 100%;margin-bottom: 20px;"  row-key="id"  border >
                <el-table-column   prop="id" label="ID" width="80"> </el-table-column>
                <el-table-column   prop="afterSaleTemplateId" label="售后模板ID" min-width="280"> </el-table-column>   
                <el-table-column   prop="name" label="模板名称" min-width="280"> </el-table-column> 
               <el-table-column   prop="protectionPeriod" label="货物描述不符和质量问题接受的保障期限 " min-width="380"> 
                    <template v-slot="{row}">
                        {{row.protectionPeriod}}天
                    </template>
               </el-table-column>
                <el-table-column   prop="returnDeadline"  label="退货期限" > 
                    <template v-slot="{row}">
                        <span v-if="row.returnDeadline===3">
                            3天退货
                        </span>
                        <span   v-if="row.returnDeadline===7">
                            7天退货                              
                        </span>  
                        <span   v-if="row.returnDeadline===15">
                         15天退货                         
                        </span>   
                    </template>                      
                </el-table-column> 
                <el-table-column   prop="freightBear"  label="运费承担方" > 
                    <template v-slot="{row}">
                        <span v-if="row.freightBear===1">
                               卖家
                            </span>
                            <span   v-if="row.freightBear===0">
                               买家                              
                        </span>   
                    </template>                          
                </el-table-column>
               <el-table-column   prop="returnRefund"  label="退货退款" > 
                  <template v-slot="{row}">
                        <span v-if="row.returnRefund===1">
                            退款保留货
                        </span>
                        <span   v-if="row.returnRefund===10">
                            买家支付运费                              
                        </span>  
                         <span   v-if="row.returnRefund===20">
                          卖家支付运费                              
                        </span>   
                    </template>                      
                </el-table-column> 
                <el-table-column   prop="status"  label="状态" width="100">
                    <template v-slot="{row}">
                        <span v-if="row.status===1">
                            <el-tag type="success">启用</el-tag>
                        </span>
                        <span   v-if="row.status===0">
                            <el-tag type="danger">删除</el-tag>                                                
                        </span>
                    </template>
                </el-table-column>               
            </el-table>
            <!-- page -->          
        </el-card>   
  
    </div>

    <script>
        new Vue({
            el: '#app',
            data: function () {
                return {    
                  
                    total:0,   //分页总页数      
                    tablelist:[] ,              
                    searchForm: { 
                        pagenum: 1,
                        pagesize: 20, 
                    },      
                   
                }
            },
            mounted(){        
                this.getSearch()
            },
            methods: {        

                async getDatalist() {
                    const res = await axios.post('/admin/Config/aftersale_template', {params: this.searchForm})
                        if (res.status !== 1) {
                            return this.$message.error(res.info);
                        }
                    this.total = res.info.total
                    this.tablelist = res.info

                },
                    
                handleSizeChange(newSize) {
                    this.searchForm.pagesize = newSize
                    this.getDatalist()
                },
                handleCurrentChange(newPage) {
                    this.searchForm.pagenum = newPage
                    this.getDatalist()
                },
                    
                getSearch() {
                    this.searchForm.pagenum = 1
                    this.getDatalist()
                },
            
           
            }   
        })
    </script>
</body>  
</html>
